﻿Namespace Logging

    ''' <summary>
    ''' Represents an entry to add or retrieve from the activity log.
    ''' </summary>
    Public Class LogEntry

        ''' <summary>
        ''' Represents a type of item.
        ''' </summary>
        Public Enum ItemType As Byte

            ''' <summary>
            ''' The item type is a song item.
            ''' </summary>
            Song

        End Enum

        ''' <summary>
        ''' Represents the action performed on an item.
        ''' </summary>
        Public Enum Action As Byte

            ''' <summary>
            ''' Indicates that the item was shown.
            ''' </summary>
            Shown

            ''' <summary>
            ''' Indicates that the item was hidden.
            ''' </summary>
            Hidden

        End Enum

        Private FItemSort As ItemType

        ''' <summary>
        ''' Gets the type of item acted upon.
        ''' </summary>
        ''' <value>The type of item acted upon.</value>
        Public ReadOnly Property ItemSort() As ItemType
            Get
                Return FItemSort
            End Get
        End Property

        Private FItemID As Guid

        ''' <summary>
        ''' Gets the item's ID.
        ''' </summary>
        ''' <value>The item's ID.</value>
        Public ReadOnly Property ItemID() As Guid
            Get
                Return FItemID
            End Get
        End Property

        Private FTime As DateTime = Now

        ''' <summary>
        ''' Gets the time of the action.
        ''' </summary>
        ''' <value>The time of the action.</value>
        Public ReadOnly Property Time() As DateTime
            Get
                Return FTime
            End Get
        End Property

        Private FActionPerformed As Action

        ''' <summary>
        ''' Gets the action performed.
        ''' </summary>
        ''' <value>The action performed.</value>
        Public ReadOnly Property ActionPerformed() As Action
            Get
                Return FActionPerformed
            End Get
        End Property

        Friend Sub New(ByVal itemSort As ItemType, _
                       ByVal itemID As Guid, _
                       ByVal time As Date, _
                       ByVal actionPerformed As Action)

            FItemSort = itemSort
            FItemID = itemID
            FTime = time
            FActionPerformed = actionPerformed

        End Sub

    End Class

End Namespace